﻿<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="PhotoBrowser.aspx.cs" Inherits="PhotoBrowserPage" %>

<%@ Register assembly="System.Web.Silverlight" namespace="System.Web.UI.SilverlightControls" tagprefix="asp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<%
    
    /* The following script block is required to run photo browser.
     * These functions are called by PhotoBrowser.
     * 
     * GetServiceUrl():
     * This function provides the current url of webservice to client application
     * 
     * GetAlbumId():
     * Posts the current album identifier to PhotoBrowser application.
     * 
     * DownloadImage(id):
     * handles the save button of PhotoBrowser application and ensures
     * the download operation.
     * 
     * DeleteAlbumCompleted():
     * Called when the current album deleted from PhotoBrowser.
     * 
     * UpdateAlbumCompleted():
     * Called when the current album update in PhotoBrowser
     * to reload parent site, or other required operation.
    */
        
     %>
<head runat="server">
    <title></title>
    <script language="javascript" type="text/javascript">
    <!--
    function GetServiceUrl() 
        {
            return "<%=this.GetServiceUrl()%>";
        }

        function GetAlbumId() 
        {
            return "<%=this.AlbumID%>";
        }

        function DownloadImage(id) 
        {
            var objFrame = document.getElementById("downloadImageFrame");
            objFrame.src = "DownloadPhoto.aspx?id=" + id;
        }

        function DeleteAlbumCompleted() {
            if (window.opener != window) {
                window.opener.document.location.href = "Default.aspx";
                window.close();
            }
            else
                document.location.href='Default.aspx';
        }

        function AlbumUpdateCompleted()
        {
            if (window.opener != window)
                window.opener.document.location.href = "Default.aspx";
        }
//-->
    </script>
</head>
<body style="height:100%;margin:0;">
    <form id="form1" runat="server" style="height:100%;">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <div  style="height:100%;">
            <asp:Silverlight ID="Xaml1" runat="server" Source="~/ClientBin/Panaglobe.Silverlight.PhotoBrowser.xap" MinimumVersion="2.0.31005.0" Width="100%" Height="100%" />
        </div>
        <iframe style="width: 1px; height: 1px; visibility: hidden;" id="downloadImageFrame"></iframe>
    </form>
</body>
</html>
